package com.efast.dmom.mgmt.bean.mes;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.efast.dmom.mgmt.bean.mes.plan.PlanCapacityBean;

/**
 * 工作日历与班次的中间表
 * */
public class MesCalendarShiftRelation{


	private Integer relationId;
	
	private Integer calendarId;
	
	private Date calendar;
	
	private Integer jph;
	
	private Integer planInput;
	
	private Integer planOutput;
	
	private Integer shiftId;
	
	private String createUser;
	
	private Date createTime;
	
	private Date lastUpdateTime;
	
	private String lastUpdateUser;

	private String model;
	
	private String factoryCode;
	
	private int scheduledCount;
	
	private String plant;
	
	private int planId;
	
	private int scheduleCounter;
	
	private List<PlanCapacityBean> capacityList = null;
	
	
	public int getScheduleCounter() {
		return scheduleCounter;
	}

	public void setScheduleCounter(int scheduleCounter) {
		this.scheduleCounter = scheduleCounter;
	}

	public List<PlanCapacityBean> getCapacityList() {
		
		if(capacityList == null){
			
			capacityList = new ArrayList<PlanCapacityBean>();
		}
		return capacityList;
	}

	public void setCapacityList(List<PlanCapacityBean> capacityList) {
		this.capacityList = capacityList;
	}

	public int getPlanId() {
		return planId;
	}

	public void setPlanId(int planId) {
		this.planId = planId;
	}

	public String getPlant() {
		return plant;
	}

	public void setPlant(String plant) {
		this.plant = plant;
	}

	public int getScheduledCount() {
		return scheduledCount;
	}

	public void setScheduledCount(int scheduledCount) {
		
		if(scheduledCount > 0){
			
			PlanCapacityBean capacityBean = new PlanCapacityBean();
			
			capacityBean.setFactoryCode(this.getFactoryCode());
			capacityBean.setModelType(this.getModel());
			capacityBean.setPlanId(this.getPlanId());
			capacityBean.setScheduleCount(scheduledCount);
			capacityBean.setPlanDate(this.getCalendar());
			capacityBean.setShop(this.getPlant());
			
			this.getCapacityList().add(capacityBean);
		}
		this.scheduledCount = scheduledCount;
	}

	public String getFactoryCode() {
		return factoryCode;
	}

	public void setFactoryCode(String factoryCode) {
		this.factoryCode = factoryCode;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public Integer getRelationId() {
		return relationId;
	}

	public void setRelationId(Integer relationId) {
		this.relationId = relationId;
	}

	public Integer getCalendarId() {
		return calendarId;
	}

	public void setCalendarId(Integer calendarId) {
		this.calendarId = calendarId;
	}

	public Date getCalendar() {
		return calendar;
	}

	public void setCalendar(Date calendar) {
		this.calendar = calendar;
	}

	public Integer getJph() {
		return jph;
	}

	public void setJph(Integer jph) {
		this.jph = jph;
	}

	public Integer getPlanInput() {
		return planInput;
	}

	public void setPlanInput(Integer planInput) {
		this.planInput = planInput;
	}

	public Integer getPlanOutput() {
		return planOutput;
	}

	public void setPlanOutput(Integer planOutput) {
		this.planOutput = planOutput;
	}

	public Integer getShiftId() {
		return shiftId;
	}

	public void setShiftId(Integer shiftId) {
		this.shiftId = shiftId;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}

	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

	public String getLastUpdateUser() {
		return lastUpdateUser;
	}

	public void setLastUpdateUser(String lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}

}
